<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!--  引入核心皮肤-->
    <link rel="stylesheet" href="../../layui/css/layui.css">
    <!--   引入核心js-->
    <script src="../../layui/layui.js"></script>
</head>
<body>
<table id="dg"></table>
<script>
    layui.use(['table'],function () {
        let table = layui.table;//定义表格组件
        table.render({
            elem: '#dg',
            url: '../../grade/allGrade',
            //page: true,//开启分页
            parseData:function (res){
                console.log(res)
                return{
                    "code":0
                    ,"msg":""
                    ,"count":10
                    ,"data":res
                }
            },
            cols: [[ //表头
                {type: 'checkbox'}
                ,{field: 'gradeid', title: '成绩ID'}
                ,{field: 'gradename', title: '科目名称'}
                ,{field: 'stuid', title: '学生ID'}
                ,{field: 'grade', title: '成绩'}
            ]]

        })
    })
</script>
</body>
</html>